/**
 * @ toast
 * @ author hexj
 * @desc  提示框
 */
let compData = {
  '_toast_.isHide': false,
  // 控制组件显示隐藏
  '_toast_.content': '' // 显示的内容
};
let showToast = {
  makeToast(message) {
    this.setData({
      '_toast_.isHide': true,
      '_toast_.content': message || ''
    });
    setTimeout(() => {
      this.setData({
        '_toast_.isHide': false
      });
    }, 1000);
  }
};
function currToast() {
  let app = getApp(),
    curPage = app.getLastPage();
  this.__page = curPage;
  Object.assign(curPage, showToast);
  curPage.showToast = this;
  curPage.setData(compData);
  return this;
}
module.exports = {
  currToast
};